home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-05-24 | 2.0 KB | 50 lines | [TEXT/ttxt] |
- Settings File = TestBed
- Script Name = CreateStamp
- Command Key =
- F-key =
- Menu = NO
- Button = NO
-
- 1 Remark "This creates a variable named 'stamp' that"
- 2 Remark "contains a string composed of the date and"
- 3 Remark "time. It is useful for naming files created by"
- 4 Remark "MicroPhone II who's names need to be"
- 5 Remark "unique. You can concatenate it other strings"
- 6 Remark "you create yourself."
- 7 Remark "====================================="
- 8 Remark "Get the raw date & time"
- 9 Remark "====================================="
- 10 Set Variable dy from Expression "=STRING(DAY)"
- 11 Set Variable mth from Expression "=STRING(MONTH)"
- 12 Set Variable yr from Expression "=STRING(YEAR)"
- 13 Set Variable hr from Expression "=STRING(HOUR)"
- 14 Set Variable mn from Expression "=STRING(MINUTE)"
- 15 Set Variable sec from Expression "=STRING(SECOND)"
- 16 Remark "====================================="
- 17 Remark "Pad strings with leading zeros if needed."
- 18 Remark "====================================="
- 19 If Expression "=LENGTH(dy) < 2"
- 20 Set Variable dy from Expression "='0',dy"
- 21 End If
- 22 If Expression "=LENGTH(mth) < 2"
- 23 Set Variable mth from Expression "='0',mth"
- 24 End If
- 25 If Expression "=LENGTH(hr) < 2"
- 26 Set Variable hr from Expression "='0',hr"
- 27 End If
- 28 If Expression "=LENGTH(mn) < 2"
- 29 Set Variable mn from Expression "='0',mn"
- 30 End If
- 31 If Expression "=LENGTH(sec) < 2"
- 32 Set Variable sec from Expression "='0',sec"
- 33 End If
- 34 Remark "====================================="
- 35 Remark "Extract the last two digits of the year."
- 36 Remark "====================================="
- 37 Set Variable yr from Expression "=MID(yr,3,2)"
- 38 Remark "====================================="
- 39 Remark "Now concatenate the values into one string"
- 40 Remark "Format of 'stamp' is: mmddyy.hhmmss"
- 41 Remark "====================================="
- 42 Set Variable stamp from Expression "=mth,dy,yr,'.',hr,mn,sec"
-